using System;
using System.Collections.Generic;

using Castle.Windsor;

namespace Brilliance
{
    public class Container : WindsorContainer, IContainer
    {
        public T Get<T>()
        {
            return (T)this[typeof(T)];
        }

        void IContainer.AddComponent<TInterface, TConcrete>()
        {
            AddComponent(typeof(TInterface), typeof(TConcrete));
        }

        private void AddComponent(Type serviceType, Type type)
        {
            AddComponent(serviceType.Name, serviceType, type);
        }

        public void AddComponentInstance(Type serviceType, object instance)
        {
            AddComponentInstance(serviceType.Name, serviceType, instance);
        }

        public void AddComponentInstance<TInterface>(TInterface instance)
        {
            AddComponentInstance(typeof(TInterface), instance);
        }

        public void AddComponentInstance(string key, Type serviceType, object instance)
        {
            base.Kernel.AddComponentInstance(key, serviceType, instance);
        }

        void IContainer.AddComponent(string key, Type service, Type type)
        {
            base.AddComponent(key, service, type);
        }

        public void AddEventAgentConfiguration(string eventAgent)
        {
            throw new NotImplementedException();
        }

        public bool HasComponent(string key)
        {
            throw new NotImplementedException();
        }

        public void AddComponentConfiguration(string componentKey, string parameterName, string parameterKey)
        {
            throw new NotImplementedException();
        }
    }
}